#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "aboutdialog.h"
#include <QMessageBox>
#include <opencv2/opencv.hpp>
#include <opencv2/core/fast_math.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <QFileDialog>
#include <QBuffer>
#include <QInputDialog>
#include <QLabel>
#include <Vector>


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void fillMainLabel();//将mat类型图片放到窗里显示



private slots:
    void on_actAbout_triggered();

    void on_actQuit_triggered();

    void on_actOpen_triggered();

    void on_actSave_triggered();

    void on_actGray_triggered();

    void on_actBinaryzation_triggered();

    void on_actOring_triggered();

    void on_actiAverageFilter_triggered();

    void on_act3x3medianFilter_triggered();

    void on_actLaplace_triggered();

    void on_actEdgeDetection_triggered();

    void on_actSetBinValue_triggered();

    void on_actHistogram_triggered();

    void on_actBGRHis_triggered();

private:
    Ui::MainWindow *ui;

    cv::Mat theMat;//默认mat
    QString openPixPath;//原始图片路径
    cv::Mat currentMat;//当前显示的mat

    QImage::Format currentFormat;//当前mat的对应的img格式

    int binValue;//保存当前二值化阈值
    QLabel* statueLabel;
    virtual void resizeEvent(QResizeEvent* event);//重写窗口尺寸变换函数,是图片大小自适应

};
#endif // MAINWINDOW_H
